<template>
  <div>
    <input type="text" placeholder="你的名字" v-model="name" />
  </div>
</template>

<script setup lang='ts' name=''>
import { ref,watch } from 'vue';


const name = ref('')


watch([name],(newValue,oldValue) => {
  console.log('新值',newValue);
  console.log('旧值',oldValue);
},{deep:true,immediate:true})


watch(name,()=>{

})

</script>

<style scoped>
  #input{
    text-align: center;
    margin: 20px auto;
    width: 300px;
    height: 200px;

  }
</style>